package Person;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86138
 * Date: 2024-05-27
 * Time: 21:37
 */
public class Daimakuai {
    public String name;
    public int age;
    public int num;
    public static int classname;

    //实例代码块/构造代码块
    {
        this.name = "z";
        this.age = 18;
        this.num = 11;
        System.out.println("构造");
    }

    //静态代码块
    static {
        classname = 1;
        System.out.println("静态");

    }

    //构造代码块
    {
        this.name = "z";
        this.age = 18;
        this.num = 11;
        System.out.println("构造");
    }

    //打印
    public void print(){
        System.out.println("班级 " + classname + "  姓名 " + this.name + "  年龄 " + this.age + "  座号 " + this.num);
    }


    public static void main(String[] args) {
        Daimakuai stu = new Daimakuai();
        stu.print();
    }
}
